function check() {
    if (form.sname.value === "") {
        alert("姓名不能为空！");
        form.sname.focus();
        return false;
    }
    if (form.password.value === "") {
        alert("请输入密码 ！");
        form.password.focus();
        return false;
    }
    if (form.password2.value === "") {
        alert("请再次输入密码 ！");
        form.password2.focus();
        return false;
    }
    if (form.password.value !== form.password2.value) {
        alert("两次输入的密码不一致 ！");
        form.password2.focus();
        return false;
    }
}